#!/bin/bash
# ***************************************************************
# *                    simula+@metz.ensam.fr                    *
# *	              GNU/linux version 0.2.2                   *
# ***************************************************************/
# * copyright  2003,2004,2005,2006,2007 COLLARD Christophe
# * copyright  2003,2004,2005,2006,2007 Laboratoire de Physique et Mcanique des Matriaux (LPMM - UMR 7554)
# * copyright  2003,2004,2005,2006,2007 Laboratoire de Mathmatiques et ses Applications de Valenciennes (LAMAV - EA 4015)
# ***************************************************************/


# color definition
GREEN="\\033[1;32m"
NORMAL="\\033[0;39m"
RED="\\033[1;31m"
PINK="\\033[1;35m"
BLUE="\\033[1;34m"
WHITE="\\033[0;02m"
LIGHTWHITE="\\033[1;08m"
YELLOW="\\033[1;33m"
CYAN="\\033[1;36m"


# checks Simula+ has been started correctly
if [ "$rat" != "true" ]; then
    echo -e $RED"Please, configure & execute 'run simula+ tests' to start tests"$NORMAL
    exit
fi


cd materials
if [ -f materials.exe ]; then 
    rm materials.exe
fi
$compiler -w -I $SimulaPlus -o materials.exe tests-materials.cpp
if [ -f materials.exe ]; then 
     ./materials.exe
     rm materials.exe
     rm *.res
else if [ -f ../simula+.old ]; then
        mv -f ../simula+.old ../simula+.bak
     fi
fi
cd ..
